package com.hgd.security.evp.biz.biz;

import com.hgd.security.evp.common.biz.BusinessBiz;
import com.hgd.security.evp.common.util.EmptyUtil;
import com.hgd.security.evp.common.util.ObjectResultResponse;
import org.springframework.stereotype.Service;

import com.hgd.security.evp.biz.entity.EvpNews;
import com.hgd.security.evp.biz.mapper.EvpNewsMapper;

/**
 * 
 *
 * @author By Shang
 * @email ${email}
 * @version 2019-04-01 22:48:19
 */
@Service
public class EvpNewsBiz extends BusinessBiz<EvpNewsMapper,EvpNews> {

    /**
     * 根据ID获取新闻
     * @param id
     * @return
     */
    public ObjectResultResponse<EvpNews> getEvpNewsById(Integer id) {
        ObjectResultResponse<EvpNews> restresult=new ObjectResultResponse<>();

        EvpNews evpNews = this.selectById(id);

        if(EmptyUtil.isEmpty(evpNews)){
            evpNews=new EvpNews();
        }
        restresult.setData(evpNews);

        return restresult;
    }
}